﻿Imports Mystery

Public Interface IContentActionButtonProvider
    Function getAll(content As IContent) As IEnumerable(Of IContentActionButton)
End Interface

Public Class ContentActionButtonAttr
    Inherits MysteryDefaultClassAttribute

    Public Property implementing_type As Type
    Private creator As IContentActionButtonProvider

    Public Overrides Sub setUp()
        If implementing_type IsNot Nothing Then
            implementing_type.GetInterfaceMap(GetType(IContentActionButtonProvider))
            creator = getGlobalObject(Of FastActivator).createInstance(implementing_type)
        End If
    End Sub

    Public Function getAll(content As IContent) As IEnumerable(Of IContentActionButton)
        If creator Is Nothing Then Return New List(Of IContentActionButton)(0)
        Return creator.getAll(content)
    End Function
End Class
